<template>
	<view class="message-list_main">
		<view class="message-list" @click="handleToMessageDetails(item.id)"
			  v-for="(item, index) in dataList" :key="index">
			<view class="message-list-title">
				<view class="message-sign">
					<image class="message-sign-image" src="../../static/image/messageSign.png" mode=""></image>
				</view>
				<view class="text1 text2 wwb message-list-text">
					{{item.title}}
				</view>
			</view>
			<view class="message-list-date">
				<text>华尔街见闻</text>
				<text>{{item.date_time}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
				return {
					messageList: [],
				}
			},
		props: {
			dataList: {
				type: Array,
				default: () => []
			}
		},
		methods: {
			// 跳转至消息详情
			handleToMessageDetails(id) {
				uni.navigateTo({
					url: `../../pages/message/messageDetail/index?notifId=${id}`
				})
			}
		},
		onLoad() {
		},
		watch: {
			dataList: {
				handler(val) {
					console.log(val);
					this.messageList = JSON.parse(JSON.stringify(val));
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	@import "@/asset/less/base.less";
	.message-list {
		.message-list-title {
			padding-top: 32rpx;
			font-size: 30rpx;
			color: #000000;
			display: flex;
			.message-sign {
				.message-sign-image {
					width: 15rpx;
					height: 15rpx;
					vertical-align: super;
					margin-right: 7rpx;
				}
			}
		}
		.message-list-date {
			display: flex;
			justify-content: space-between;
			color: #999999;
			font-size: 26rpx;
			padding: 22rpx 0 26rpx 20rpx;
		}
	}
</style>
